/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package a1A;
/**
 *
 * @author nisarg
 */
public class rope_intranet {
    static int input[][] = {{5,6},{7,7},{4,3},{2,1},{1,5}};
    public static void main(String args[]) {
        int row = input.length;
        int count = 0;
        for(int t=0;t<row;t++) {
            for(int i=0;i<row;i++) {
                if(i!=t) {
                    if(input[t][0]<input[i][0] && input[t][1] > input[i][1]) {
                        count++;
                    }
                }
            }
        }
        System.out.println("count = " + count);
    }
}